Skip to content

fix: use configured customer fixture in webhook address tests - #86

Merged
carolinerg1 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/webhook-customer-fixture
Aug 14, 2026
Merged

fix: use configured customer fixture in webhook address tests#86
carolinerg1 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/webhook-customer-fixture

Conversation

@FanouZeng-TT

Copy link
Copy Markdown
Contributor

Description

The two webhook address tests hardcoded the flower-shop customer instead of
using the configured fixture:

buyer_info = {"fullName": "John Doe", "email": "john.doe@example.com"}
...
self.assertEqual(expectations[0]["destination"]["address_country"], "US")

--fixture_config is a supported conformance input, and
DynamicFixtureContext.get_known_customer() already provides the customer a
merchant declares. A valid configuration with a different customer would send
the wrong buyer, while a selected non-US destination would be rejected even
when the webhook reproduced it correctly.

Fix: build both buyers from get_known_customer(), skip the tests when the
optional fixture is absent, and compare the webhook destination with the actual
destination selected from the checkout response rather than a hardcoded
country. The explicit new-address assertions (CA / Webhook St) remain
unchanged.

Category (Required)

  • Core Protocol: ...
  • Governance/Contributing: ...
  • Capability: ...
  • Documentation: ...
  • Infrastructure: ...
  • Maintenance: ...
  • SDK: ...
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: ...

Related Issues

N/A

Checklist

  • I have followed the Contributing Guide ...
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk. (Not applicable: conformance test-only change.)

Screenshots / Logs (if applicable)

N/A — webhook_test.py passed 3/3 against the local Python sample merchant server. ruff check, ruff format --check, full pre-commit, and git diff --check also passed.

@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Aug 14, 2026
@carolinerg1
carolinerg1 merged commit ca74764 into Universal-Commerce-Protocol:main Aug 14, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants